package com.xizi.proxy_static;

public class CountProxy implements Count {

    private CountImpl countImpl;

    /**
     * 覆盖默认构造器
     */
    public CountProxy(CountImpl countImpl) {
        this.countImpl = countImpl;
    }

    @Override
    public void queryCount() {
        System.out.println("==查询账户开始==");
        // 调用真正的查询账户方法
        countImpl.queryCount();
        System.out.println("==查询账户结束==");
    }

    @Override
    public void updateCount() {
        System.out.println("==更新账户开始==");
        // 调用真正的修改账户操作
        countImpl.updateCount();
        System.out.println("==更新账户结束==");
    }
}